<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>jsonp test</title>

  <style>
    #jsonp{
      width: 200px;
      height: 100px;
      border: 2px solid #f72;
    }
  </style>
</head>
<body>
  <h2>jsonp test</h2>
  <textarea id="jsonp"></textarea>

  <script type="text/javascript">
    function dojsonp(data){
      var jsonp = document.getElementById('jsonp');
      jsonp.innerHTML = JSON.stringify(data);
    }
  </script>

  <!-- 通过jsonp实现跨域请求 -->
  <script src="http://localhost:8000/jsonp-test?callback=dojsonp&name=Jack&age=44&salary=55556"></script>
</body>
</html>